#  openjdk:8-jre
FROM openjdk:8u212-jre-slim-stretch as builder
LABEL maintainer="JWong <392092915@qq.com>"
WORKDIR application
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} application.jar
RUN java -Djarmode=layertools -jar application.jar extract

FROM openjdk:8u212-jre-slim-stretch
WORKDIR application
COPY --from=builder application/dependencies/ ./
COPY --from=builder application/spring-boot-loader/ ./
COPY --from=builder application/snapshot-dependencies/ ./
COPY --from=builder application/application/ ./

EXPOSE 8600/tcp

ENTRYPOINT ["java", "org.springframework.boot.loader.JarLauncher"]